﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MySkiPatrolSite.ArticleSvc.Article>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	New
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript" src="<%= Url.Content("~/ckeditor/ckeditor.js")%>"></script>


    <!--added-->
    <link rel="stylesheet" href="http://code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css">
  <script src="http://code.jquery.com/jquery-1.10.2.js"></script>
  <script src="http://code.jquery.com/ui/1.11.2/jquery-ui.js"></script>




<div id="articles">
    <h2>News Article Editor</h2>
<form id="form1" runat="server" enctype="multipart/form-data">
    <div class="article">
    
    <%: Html.HiddenFor(m => m.ID)%>
    <%: Html.LabelFor(m => m.Title) %>: <%: Html.TextBoxFor(m => m.Title) %><br />
    <input type="hidden" id="Action" name="Action" value="<%:string.Empty %>" />

    <label>Effective:</label>
    <input type="text" id="EffectiveDate" name="EffectiveDate" class="datepicker" onchange="EffDateChange()" value="<%:Model.EffectiveDate.ToShortDateString() %>" />
    <br />
    <label>Expires:</label>
    <input type="text" id="ExpiryDate" name="ExpiryDate" class="datepicker" value="<%:Model.ExpiryDate.ToShortDateString() %>" />

    <div class="article_body">
    <textarea id="editor1" name="editor1" class="ckeditor" rows="10" cols="80"><%:Model.Body%></textarea>
    </div>
    </div>
    <br />
    
    <button type="submit" id="save" onclick="functionAction('save')">Save</button>
    <button type="submit" id="delete" onclick="functionAction('delete')">Delete</button>
    <script type="text/javascript">
        function functionAction(action) {
            document.getElementById('Action').value = action;

        }

        
    </script>
    <script type="text/javascript">
        $('.datepicker').datepicker({
            dateFormat: "m/d/y",
            showOn: "both",
            buttonImage: "/../images/DryIcons/Shine/png/24x24/calendar_date.png",
            buttonImageOnly: "true",
            minDate: "0d"

        });
</script>
<script language=javascript>
    function EffDateChange() {
        document.getElementById('ExpiryDate').value = document.getElementById('EffectiveDate').value;
    }
</script>
</form>
</div>

</asp:Content>